<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../include/admincontent.jsp" %>
<style>
    .layui-input{
        height: 24px;
    }
</style>
<div id="location">当前位置：日志管理 > 操作日志查询</div>
<div id="Content">
    <div class="help"><b>提示：</b>可输入相应的查询条件进行查询。</div>

    <div id="sy_search">
        <form id="advanceQueryParam">
            <div style="background-color: #f0f0f0">
                <div class="clearfix more_query_area">
                    <div class="query_area_body clearfix">
                        <div class="record_item">
                            <div class="record_item">
                                <div class="label width90">招聘方案名称:</div>
                                <div class="content">
                                    <div><input type="text" name="proname"/></div>
                                </div>
                            </div>
                        </div>
                        <div class="record_item">
                            <div class="record_item">
                                <div class="label">身份证号:</div>
                                <div class="content">
                                    <div><input type="text" name="cardno"/></div>
                                </div>
                            </div>
                        </div>
                        <div class="record_item">
                            <div class="record_item">
                                <div class="label">人员工号:</div>
                                <div class="content">
                                    <div><input type="text" name="operatorcode"/></div>
                                </div>
                            </div>
                        </div>
                        <div class="record_item">
                            <div class="record_item">
                                <div class="label">人员姓名:</div>
                                <div class="content">
                                    <div><input type="text" name="operatorname"/></div>
                                </div>
                            </div>
                        </div>
                        <div class="record_item">
                            <div class="record_item">
                                <div class="label">操作部门:</div>
                                <div class="content">
                                    <div><input type="text" name="operatordept"/></div>
                                </div>
                            </div>
                        </div>
                        <div class="record_item">
                            <div class="toolbars">
                                <a id="searchbtn" >
                                    <em class="ico16 search_16"></em>
                                    <span class="menu_span" title="查询">查询</span>
                                </a>
                                <a id="searchreset">
                                    <em class="ico16 refresh_16"></em>
                                    <span class="menu_span" title="重置">重置</span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <table class="layui-hide" id="test" lay-filter="test"></table>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    </script>
</div>
<link rel="stylesheet" href="/resources/js/plugins/layui/css/layui.css"  media="all">
<script src="/resources/js/plugins/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript">
    var tavkeIns;
    let layuithis;
    layui.use(['layer','form','jquery','table','util',], function(){
        layuithis = this;
        var table = layui.table;
        $ = layui.jquery;
        var form = layui.form
            ,util = layui.util;
        util.fixbar({
            top: true
            , css: {right: 10, bottom: 10}
            , bgcolor: '#393D49'
        });
        var turl='/SystemLog/Operator/getStatisticsJson';
        tavkeIns= table.render({
            elem: '#test'
            ,url:turl
            ,toolbar: true
            ,title: '用户录用结果'
            ,totalRow: false
            ,limits:[10,50,100,200,500,1000,2000,5000]
            ,cols: [[
                {field:'logid', width:80, title: 'LOGID', sort: false,hide:true}
                ,{field:'usercustom3', minWidth:160, title: '身份证号'}
                ,{field:'usercustom4', width:80, title: '姓名', sort: false}
                ,{field:'usercustom1', title: '方案名称',  minWidth: 250}
                ,{field:'usercustom2', width:120, title: '招聘流程'}
                ,{field:'usercustom5', width:100, title: '岗位', sort: false}
                ,{field:'logresult', title: '结果',  minWidth: 120}
                ,{field:'logremark', title: '备注',minWidth: 100, sort: false}
                ,{field:'operatorcode', width:100, title: '员工号', sort: false}
                ,{field:'operatorname', width:100, title: '姓名', sort: false}
               ,{field:'usercustom6', width:100, title: '部门', sort: false}
                ,{field:'operattime', title: '操作时间',minWidth: 150, sort: false}
               ,{field:'rid', title: '简历ID',  minWidth: 160,hide:true}
               ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:80}
            ]]
            ,page: true
            ,response: {
                statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
            }
            ,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": 200, //解析接口状态
                    "msg": res.message, //解析提示文本
                    "count":  res.totalResult, //解析数据长度
                    "data": res.datas //解析数据列表
                };
            }
        });

        table.on('tool(test)', function(obj){
            var data = obj.data;
            if(obj.event === 'edit'){

             var cindex=  layer.confirm('姓名:'+data.usercustom3+"<br/>身份证:"+data.usercustom4+'<br/>是否跳转至简历页面?<br/>',{icon:3,title:'提示'},function () {
                 var url = '/UserResume/ViewDResume?id='+data.rid;
                 window.open(url);
                 layer.close(cindex);
               },function () {
                  layer.close(cindex);
               });
            }
        });

        form.on('submit(loadUsers)', function(data){
            table.reload('test',{
                method:'post',
                where:{cardno:data.field.cardno,proname:data.field.proname,operatorname:data.field.operatorname,operatorcode:data.field.operatorcode,operatordept:data.field.operatordept}
            });
            return false;
        });

        $("#searchbtn").on('click', function () {

                function fun1() {
                    layui.use('table', () => {
                            tavkeIns.reload({
                                url: "/SystemLog/Operator/getStatisticsJson",
                                where: {
                                    cardno: $("input[name = 'cardno']").val(),
                                    proname: $("input[name = 'proname']").val(),
                                    operatorcode: $("input[name = 'operatorcode']").val(),
                                    operatorname: $("input[name = 'operatorname']").val(),
                                    operatordept: $("input[name = 'operatordept']").val(),
                                },
                                page: {
                                    curr: 1
                                }
                            });
                        }
                    );
                }

                fun1.call(layuithis)
            }
        );
        $("#reset").on('click', function () {
            //$("#searchform").reset();
            $("#searchform")[0].reset();
        });
    });
</script>
</body>
</html>